Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

RE: NotesDatabase.GetDocumentByUNID does NOT return Nothing?
~Elizabeth Lopfoosonikle 1.Dec.03 06:28 AM a Web browser
Applications Development 6.0.2 CF2 Windows 2000


From my quick tests, its seems that as you have said, the help is wrong and the error is thrown.

Just handle the error and you can continue on.

Here is some sample code i whipped up:

_______________________________________________
Sub Initialize
'--- Turn error handling on.
On Error Goto ErrorHandler

Dim ss As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim doc2 As NotesDocument

Dim unid As String

Set db = ss.CurrentDatabase
Set dc = db.AllDocuments
Set doc = dc.GetFirstDocument

unid = doc.UniversalID

'--- Remove the doc
doc.Remove True

'--- Try and get it by its unid we stored
Set doc2 = db.GetDocumentByUNID(unid)

'--- Check to see if the object is nothing
If doc2 Is Nothing Then
Print "ERROR"
Else
Print "No Error"
End If

Exit Sub
ErrorHandler:
Select Case Err
Case 4091
'--- This is the error code for the error thrown by there not being a match on the UNID
'--- In this case we can resum next cos doc2 will now be Nothing and will get caught in the ext part of the code.
Resume Next
Case Else
Msgbox "Error: " & Err & " occured. The message for this error is: " + Error$ + ". (LINE: " & Erl & ")"
End Select
End
End Sub
______________________________________________




NotesDatabase.GetDocumentByUNID doe... (~Lorraine Desge... 1.Dec.03)
. . RE: NotesDatabase.GetDocumentByUNID... (~Elizabeth Lopf... 1.Dec.03)
. . . . RE: NotesDatabase.GetDocumentByUNID... (~Lorraine Desge... 1.Dec.03)
. . . . . . RE: NotesDatabase.GetDocumentByUNID... (~Bill Frokimari... 1.Dec.03)
. . RE: NotesDatabase.GetDocumentByUNID... (~Lorraine Desge... 1.Dec.03)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS